Skip to content

IMAP SEARCH: send KEYWORD as an atom - #2144

Merged
the-djmaze merged 1 commit into
the-djmaze:masterfrom
filippogiuliani:fix/imap-search-keyword-atom
Nov 25, 2026
Merged

the-djmaze merged 1 commit into
the-djmaze:masterfrom
filippogiuliani:fix/imap-search-keyword-atom

Conversation

@filippogiuliani

Copy link
Copy Markdown

RFC 3501 defines the search key as "KEYWORD" SP flag-keyword, and flag-keyword = atom. SnappyMail always
sends the keyword quoted (KEYWORD "$label1"), which strict servers refuse. GreenMail, for example:

a1 SEARCH KEYWORD bills      → OK
a2 SEARCH KEYWORD "bills"    → BAD Search command not supported

so searching or filtering by a tag fails there. A plain keyword (letters, digits, _ $ . -) is now sent as is;
anything else is still quoted as before, so servers that accepted the quoted form see no difference.

Written with the help of Claude (AI), tested on a SnappyMail-based webmail.

RFC 3501 defines the KEYWORD search key as "KEYWORD" SP flag-keyword, and flag-keyword is an atom.
SnappyMail always quoted it, which strict servers refuse (BAD), so searching or filtering by a tag
failed there. A plain keyword is now sent as is; anything that is not a simple atom is still quoted
as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@the-djmaze the-djmaze added the bug Something isn't working label Nov 25, 2026
@the-djmaze
the-djmaze merged commit 6ecc622 into the-djmaze:master Nov 25, 2026
the-djmaze added a commit that referenced this pull request Nov 25, 2026
@the-djmaze

the-djmaze commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Thanks! I've improved it a bit due to changes in Thunderbird.
It now uses a special \MailSo\Imap\Flag class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants